#pragma once
#include "commom.hpp"

class Client
{
public:
    Client()
    {
    }

    bool OpenWritePipe()
    {
        _fd=openpipe(WRITEFLAG);
        if(_fd<0)
            return false;
        else
            std::cout<<"open success"<<std::endl; 
        return true;
    }

    void SendMessage(const std::string& input)
    {
        ::write(_fd,input.c_str(),bufsize);
    }

    bool closepipe()
    {
        ::close(_fd);
        std::cout << "close pipe success" << std::endl;
        return true;
    }

    ~Client()
    {
    }

private:
    int _fd;
};